/**
 * 
 */
package org.lanqiao.netctoss.service.impl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.lanqiao.netctoss.dao.AdminDao;
import org.lanqiao.netctoss.dao.AdperDao;
import org.lanqiao.netctoss.entity.Admin;
import org.lanqiao.netctoss.entity.Adper;
import org.lanqiao.netctoss.service.AdperService;
import org.lanqiao.netctoss.util.GetSession;

/**
 * @author Administrator
 *
 */
public class AdperServiceImpl implements AdperService {

	@Override
	public boolean insertAdper(Admin admin) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean deleteAdper(Adper adper) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean deleteAdperByAno(Admin admin) {
		// TODO Auto-generated method stub
		SqlSession session = GetSession.getSession();
		AdperDao adperDao = session.getMapper(AdperDao.class);
		int i = adperDao.deleteAdperByAno(admin);
		if(i>0){
			session.commit();
			session.close();
			return true;
		}else
		return false;
	}

	@Override
	public boolean updateAdper(Adper adper) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public List<Adper> selectAdper(Admin admin) {
		// TODO Auto-generated method stub
		SqlSession session = GetSession.getSession();
		AdperDao adperDao = session.getMapper(AdperDao.class);
		 List<Adper> la = adperDao.selectAdper(admin);
		if(la!=null){
			session.commit();
			session.close();
		}
		return la;
	}
}
